package object;

public class EqualsDemo {
    public static void main(String[] args) {
        /*Point p1 = new Point(100,200);
        Point p2 = new Point(100,200);
        System.out.println(p1==p2);
        //equals底层依然是比较地址
        System.out.println(p1.equals(p2));*/

        String s1 = new String("hello");
        String s2 = new String("hello");
        System.out.println(s1.equals(s2));
        StringBuilder s3 = new StringBuilder("hello");
        StringBuilder s4 = new StringBuilder("hello");
        System.out.println(s3.equals(s4));
        System.out.println(s1.equals(s3));
    }
}
